/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package estg.dae.projecto.bank.model;

import estg.dae.projecto.bank.IElectronicOperation;
import estg.dae.projecto.bank.OperationType;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;

/**
 *
 * @author Marco
 */
@Entity
@Table(name="offlineTransfers")
public class ElectronicTransfer implements IElectronicOperation, Serializable {
    @Id
    @GeneratedValue(strategy=GenerationType.AUTO)
    private Long id;
    @ManyToOne(fetch=FetchType.LAZY)
    private AccountMovement movement;
    private OperationType operationType;
    private String originNib;
    private String destinNib;
    private double trfValue;
    @Temporal(javax.persistence.TemporalType.TIMESTAMP)
    private Date trfDate;

    public void setDate(Date date) {
        this.trfDate = date;
    }

    public void setDestinNib(String destinNib) {
        this.destinNib = destinNib;
    }

    public void setOperationType(OperationType operationType) {
        this.operationType = operationType;
    }

    public void setOriginNib(String originNib) {
        this.originNib = originNib;
    }

    public void setValue(double value) {
        this.trfValue = value;
    }
    
    public OperationType getOperationType() {
        return operationType;
    }

    public String getOriginNib() {
        return originNib;
    }

    public String getDestinNib() {
        return destinNib;
    }

    public String getCardNumber() {
        return null;
    }

    public String getPaymentEntity() {
        return null;
    }

    public String getPaymentReference() {
        return null;
    }

    public double getValue() {
        return trfValue;
    }

    public Date getDate() {
        return trfDate;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public AccountMovement getMovement() {
        return movement;
    }

    public void setMovement(AccountMovement movement) {
        this.movement = movement;
    }

}
